package com.mlh.service.impl;

public class Cellphone {
    public static void main(String[] args) {
        Cellphone c=new Cellphone();
        c.alarmclock(new Bell() {
            @Override
            public void ring() {
                System.out.println("懒猪起床了");
            }
        });
        c.alarmclock(new Bell() {
            @Override
            public void ring() {
                System.out.println("小伙伴们上课啦");
            }
        });
    }
    public void alarmclock(Bell b){
        b.ring();
    }
}
interface Bell{
    public void ring();
}
